<?php
session_start();

if(isset($_SESSION['views']))
$_SESSION['views']=$_SESSION['views']+1;
else
$_SESSION['views']=1;
 $tanggal = date("Y-m-d");
$jam = date("H:i:s");

?>

<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Tes Aritmatika</title>
	

    <!-- Core CSS - Include with every page -->
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="font-awesome/css/font-awesome.css" rel="stylesheet">

    <!-- Page-Level Plugin CSS - Forms -->

    <!-- SB Admin CSS - Include with every page -->
    <link href="css/sb-admin.css" rel="stylesheet">

</head>

<body>

    
        
            <!-- /.row -->
            <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                           <?php echo $tanggal.'<br>'.$jam;?>
						   <a href="logout.php" target="_self"><span class="btn btn-small btn-danger" style="
    float: right;
    margin-top: -10px;
">Selesai</span></a>
                        </div>
                        <div class="panel-body">
                       <h1><?php echo "Nama Sesi  ". $_SESSION['sesi']; ?></h1>    

 <center>     <h1><?php echo "No  ". $_SESSION['views']; ?></h1>
                                    <form role="form" id="form1" name="form1" method="post" action="simpan_jawaban.php">
									
<?php 
$v=mt_rand(1, 9);
$x=mt_rand(1, 9); 
$y=mt_rand(1, 9);
$z=mt_rand(1, 9);
$q=mt_rand(1, 20);

$sesi= $_SESSION['sesi'] ;


if ($v >= $x) {
  
  $pm = $v-$x;
			if ($pm < $y) {
  
  $km= $pm+$y;
								if ($km < $z) {
  
  $tm= $km+$z;
  
 
  ?>
  <div class="row">
                               
                              
                                         
                                            <div class="form-group">
                                                <label for="disabledSelect">Soal</label>
                                                <input class="form-control" id="disabledInput"  type="text" name="soal" value= "<?php  echo $v."-".$x."+".$y."+".$z;  ?>" placeholder="<?php  echo $v."-".$x."+".$y."+".$z;  ?>" readonly style="
    width: 50%;  font-size: -webkit-xxx-large;  height: 90%;  font-weight: 600;  text-align: center;">
                                            </div>
											<div class="form-group">
                                                <label for="disabledSelect">Angka Acak</label>
                                                <input class="form-control" id="disabledInput" type="text" name="jawaban" value= "<?php echo $q;  ?>" placeholder="<?php echo $q;  ?>" readonly style="
    width: 50%;  font-size: -webkit-xxx-large;  height: 90%;  font-weight: 600;  text-align: center;">
                                            </div>  </fieldset>
											<br>
											
											
											<input class="form-control" id="disabledInput" type="hidden" name ="tanggal" value = "<?php echo $tanggal;  ?>" placeholder="<?php echo $tanggal;  ?>" readonly>
											<input class="form-control" id="disabledInput" type="hidden" name ="jam" value = "<?php echo $jam;  ?>" placeholder="<?php echo $jam;  ?>" readonly>
											<input class="form-control" id="disabledInput" type="hidden" name="jumlah_soal" value = "<?php echo "SOAL  ". $_SESSION['views']; ?>" placeholder="<?php echo "SOAL  ". $_SESSION['views']; ?>" readonly>
											<input class="form-control" id="disabledInput" type="hidden" name="jawab_hitung" value = "<?php echo $tm; ?>" placeholder="<?php echo $tm; ?>" readonly>
											<input class="form-control" id="disabledInput" type="hidden" name="sesi" value = "<?php echo $sesi; ?>" placeholder="<?php echo $sesi; ?>" readonly>
											
											
											<div class="form-group">
                                            <label>Pilihan</label>
                                            <div class="radio">
                                                <label>
                                                    <input type="radio" name="optionsRadios" id="optionsRadios1" value="lebih besar dari angka acak" checked>>
                                                </label>
                                            
                                            
                                                <label>
                                                    <input type="radio" name="optionsRadios" id="optionsRadios2" value="sama dengan">=
                                                </label>
                                            
                                            
                                                <label>
                                                    <input type="radio" name="optionsRadios" id="optionsRadios3" value="lebih kecil dari angka acak"><
                                                </label>
                                            </div>
                                        </div>
										<button type="submit" class="btn btn-default">Submit</button>
                                           <br><br><br><br><br><br><br><br>
                                        </div>
										
  
  <?php
  }
								if ($km >= $z) {
  
  $tm= $km-$z;
  
  ?>
  

  <div class="row">
                               
                              
                                         
                                            <div class="form-group">
                                                <label for="disabledSelect">Soal</label>
                                                <input class="form-control" id="disabledInput" type="text" name="soal" value="<?php  echo $v."-".$x."+".$y."-".$z;  ?>" placeholder="<?php  echo $v."-".$x."+".$y."-".$z;  ?>" readonly style="
    width: 50%;  font-size: -webkit-xxx-large;  height: 90%;  font-weight: 600;  text-align: center;">
                                            </div>
											<div class="form-group">
                                                <label for="disabledSelect">Angka Acak</label>
                                                <input class="form-control" id="disabledInput" type="text" name="jawaban" value="<?php echo $q;  ?>" placeholder="<?php echo $q;  ?>" readonly style="
    width: 50%;  font-size: -webkit-xxx-large;  height: 90%;  font-weight: 600;  text-align: center;">
                                            </div>  </fieldset>
											<br>
											
											
											<input class="form-control" id="disabledInput" type="hidden" name ="tanggal" value = "<?php echo $tanggal;  ?>" placeholder="<?php echo $tanggal;  ?>" readonly>
											<input class="form-control" id="disabledInput" type="hidden" name ="jam" value = "<?php echo $jam;  ?>" placeholder="<?php echo $jam;  ?>" readonly>
											<input class="form-control" id="disabledInput" type="hidden" name="jumlah_soal" value = "<?php echo "SOAL  ". $_SESSION['views']; ?>" placeholder="<?php echo "SOAL  ". $_SESSION['views']; ?>" readonly>
											<input class="form-control" id="disabledInput" type="hidden" name="jawab_hitung" value = "<?php echo $tm; ?>" placeholder="<?php echo $tm; ?>" readonly>
											<input class="form-control" id="disabledInput" type="hidden" name="sesi" value = "<?php echo $sesi; ?>" placeholder="<?php echo $sesi; ?>" readonly>
											
											<div class="form-group">
                                            <label>Pilihan</label>
                                            <div class="radio">
                                                <label>
                                                    <input type="radio" name="optionsRadios" id="optionsRadios1" value="lebih besar dari angka acak" checked>>
                                                </label>
                                            
                                            
                                                <label>
                                                    <input type="radio" name="optionsRadios" id="optionsRadios2" value="sama dengan">=
                                                </label>
                                            
                                            
                                                <label>
                                                    <input type="radio" name="optionsRadios" id="optionsRadios3" value="lebih kecil dari angka acak"><
                                                </label>
                                            </div>
                                        </div>
										<button type="submit" class="btn btn-default">Submit</button>
                                           <br><br><br><br><br><br><br><br>
                                        </div>
										
<?php										
  }
	

  
  }
			if ($pm >= $y) {
  
  $km= $pm-$y;
  
  
								if ($km >= $z) {
  
  $tm= $km-$z;
  
  ?>
  <div class="row">
                               
                              
                                         
                                            <div class="form-group">
                                                <label for="disabledSelect">Soal</label>
                                                <input class="form-control" id="disabledInput" type="text" name="soal" value="<?php  echo $v."-".$x."-".$y."-".$z;  ?>" placeholder="<?php  echo $v."-".$x."-".$y."-".$z;  ?>" readonly style="
    width: 50%;  font-size: -webkit-xxx-large;  height: 90%;  font-weight: 600;  text-align: center;">
                                            </div>
											<div class="form-group">
                                                <label for="disabledSelect">Angka Acak</label>
                                                <input class="form-control" id="disabledInput" type="text" name="jawaban" value="<?php echo $q;  ?>" placeholder="<?php echo $q;  ?>" readonly style="
    width: 50%;  font-size: -webkit-xxx-large;  height: 90%;  font-weight: 600;  text-align: center;">
                                            </div>  </fieldset>
											<br>
											
											
											
											<input class="form-control" id="disabledInput" type="hidden" name ="tanggal" value = "<?php echo $tanggal;  ?>" placeholder="<?php echo $tanggal;  ?>" readonly>
											<input class="form-control" id="disabledInput" type="hidden" name ="jam" value = "<?php echo $jam;  ?>" placeholder="<?php echo $jam;  ?>" readonly>
											<input class="form-control" id="disabledInput" type="hidden" name="jumlah_soal" value = "<?php echo "SOAL  ". $_SESSION['views']; ?>" placeholder="<?php echo "SOAL  ". $_SESSION['views']; ?>" readonly>
											<input class="form-control" id="disabledInput" type="hidden" name="jawab_hitung" value = "<?php echo $tm; ?>" placeholder="<?php echo $tm; ?>" readonly>
											<input class="form-control" id="disabledInput" type="hidden" name="sesi" value = "<?php echo $sesi; ?>" placeholder="<?php echo $sesi; ?>" readonly>
											
											
											<div class="form-group">
                                            <label>Pilihan</label>
                                            <div class="radio">
                                                <label>
                                                    <input type="radio" name="optionsRadios" id="optionsRadios1" value="lebih besar dari angka acak" checked>>
                                                </label>
                                            
                                            
                                                <label>
                                                    <input type="radio" name="optionsRadios" id="optionsRadios2" value="sama dengan">=
                                                </label>
                                            
                                            
                                                <label>
                                                    <input type="radio" name="optionsRadios" id="optionsRadios3" value="lebih kecil dari angka acak"><
                                                </label>
                                            </div>
                                        </div>
										<button type="submit" class="btn btn-default">Submit</button>
                                           <br><br><br><br><br><br><br><br>
                                        </div>
<?php										
  }
								if ($km < $z) {
  
  $tm= $km+$z;
  
  ?>
  <div class="row">
                               
                              
                                         
                                            <div class="form-group">
                                                <label for="disabledSelect">Soal</label>
                                                <input class="form-control" id="disabledInput" type="text" name="soal" value="<?php  echo $v."-".$x."-".$y."+".$z;  ?>" placeholder="<?php  echo $v."-".$x."-".$y."+".$z;  ?>" readonly style="
    width: 50%;  font-size: -webkit-xxx-large;  height: 90%;  font-weight: 600;  text-align: center;">
                                            </div>
											<div class="form-group">
                                                <label for="disabledSelect">Angka Acak</label>
                                                <input class="form-control" id="disabledInput" type="text" name="jawaban" value="<?php echo $q;  ?>" placeholder="<?php echo $q;  ?>" readonly style="
    width: 50%;  font-size: -webkit-xxx-large;  height: 90%;  font-weight: 600;  text-align: center;">
                                            </div>  </fieldset>
											<br>
											
											
											
											<input class="form-control" id="disabledInput" type="hidden" name ="tanggal" value = "<?php echo $tanggal;  ?>" placeholder="<?php echo $tanggal;  ?>" readonly>
											<input class="form-control" id="disabledInput" type="hidden" name ="jam" value = "<?php echo $jam;  ?>" placeholder="<?php echo $jam;  ?>" readonly>
											<input class="form-control" id="disabledInput" type="hidden" name="jumlah_soal" value = "<?php echo "SOAL  ". $_SESSION['views']; ?>" placeholder="<?php echo "SOAL  ". $_SESSION['views']; ?>" readonly>
											<input class="form-control" id="disabledInput" type="hidden" name="jawab_hitung" value = "<?php echo $tm; ?>" placeholder="<?php echo $tm; ?>" readonly>
											<input class="form-control" id="disabledInput" type="hidden" name="sesi" value = "<?php echo $sesi; ?>" placeholder="<?php echo $sesi; ?>" readonly>
											
											
											<div class="form-group">
                                            <label>Pilihan</label>
                                            <div class="radio">
                                                <label>
                                                    <input type="radio" name="optionsRadios" id="optionsRadios1" value="lebih besar dari angka acak" checked>>
                                                </label>
                                            
                                            
                                                <label>
                                                    <input type="radio" name="optionsRadios" id="optionsRadios2" value="sama dengan">=
                                                </label>
                                            
                                            
                                                <label>
                                                    <input type="radio" name="optionsRadios" id="optionsRadios3" value="lebih kecil dari angka acak"><
                                                </label>
                                            </div>
                                        </div>
										<button type="submit" class="btn btn-default">Submit</button>
                                           <br><br><br><br><br><br><br><br>
                                        </div>
<?php										
  }  
  }  
}

if ($v < $x) {
  
  $pm = $v+$x;
			if ($pm < $y) {
  
  $km= $pm+$y;
								if ($km < $z) {
  
  $tm= $km+$z;
 
 ?>
 <div class="row">
                               
                              
                                         
                                            <div class="form-group">
                                                <label for="disabledSelect">Soal</label>
                                                <input class="form-control" id="disabledInput" type="text" name="soal" value="<?php  echo $v."+".$x."+".$y."+".$z;  ?>" placeholder="<?php  echo $v."+".$x."+".$y."+".$z;  ?>" readonly style="
    width: 50%;  font-size: -webkit-xxx-large;  height: 90%;  font-weight: 600;  text-align: center;">
                                            </div>
											<div class="form-group">
                                                <label for="disabledSelect">Angka Acak</label>
                                                <input class="form-control" id="disabledInput" type="text" name="jawaban" value="<?php echo $q;  ?>" placeholder="<?php echo $q;  ?>" readonly style="
    width: 50%;  font-size: -webkit-xxx-large;  height: 90%;  font-weight: 600;  text-align: center;">
                                            </div>  </fieldset>
											<br>
											
											
											
											
											<input class="form-control" id="disabledInput" type="hidden" name ="tanggal" value = "<?php echo $tanggal;  ?>" placeholder="<?php echo $tanggal;  ?>" readonly>
											<input class="form-control" id="disabledInput" type="hidden" name ="jam" value = "<?php echo $jam;  ?>" placeholder="<?php echo $jam;  ?>" readonly>
											<input class="form-control" id="disabledInput" type="hidden" name="jumlah_soal" value = "<?php echo "SOAL  ". $_SESSION['views']; ?>" placeholder="<?php echo "SOAL  ". $_SESSION['views']; ?>" readonly>
											<input class="form-control" id="disabledInput" type="hidden" name="jawab_hitung" value = "<?php echo $tm; ?>" placeholder="<?php echo $tm; ?>" readonly>
											<input class="form-control" id="disabledInput" type="hidden" name="sesi" value = "<?php echo $sesi; ?>" placeholder="<?php echo $sesi; ?>" readonly>
											
											
											<div class="form-group">
                                            <label>Pilihan</label>
                                            <div class="radio">
                                                <label>
                                                    <input type="radio" name="optionsRadios" id="optionsRadios1" value="lebih besar dari angka acak" checked>>
                                                </label>
                                            
                                            
                                                <label>
                                                    <input type="radio" name="optionsRadios" id="optionsRadios2" value="sama dengan">=
                                                </label>
                                            
                                            
                                                <label>
                                                    <input type="radio" name="optionsRadios" id="optionsRadios3" value="lebih kecil dari angka acak"><
                                                </label>
                                            </div>
                                        </div>
										<button type="submit" class="btn btn-default">Submit</button>
                                           <br><br><br><br><br><br><br><br>
                                        </div>
  
  <?php
  }
								if ($km >= $z) {
 
  $tm= $km-$z;
 
  ?>
  <div class="row">
                               
                              
                                         
                                            <div class="form-group">
                                                <label for="disabledSelect">Soal</label>
                                                <input class="form-control" id="disabledInput" type="text" name="soal" value="<?php  echo $v."+".$x."+".$y."-".$z;  ?>" placeholder="<?php  echo $v."+".$x."+".$y."-".$z;  ?>" readonly style="
    width: 50%;  font-size: -webkit-xxx-large;  height: 90%;  font-weight: 600;  text-align: center;">
                                            </div>
											<div class="form-group">
                                                <label for="disabledSelect">Angka Acak</label>
                                                <input class="form-control" id="disabledInput" type="text" name="jawaban" value="<?php echo $q;  ?>" placeholder="<?php echo $q;  ?>" readonly style="
    width: 50%;  font-size: -webkit-xxx-large;  height: 90%;  font-weight: 600;  text-align: center;">
                                            </div>  </fieldset>
											<br>
											
											
											
											
											<input class="form-control" id="disabledInput" type="hidden" name ="tanggal" value = "<?php echo $tanggal;  ?>" placeholder="<?php echo $tanggal;  ?>" readonly>
											<input class="form-control" id="disabledInput" type="hidden" name ="jam" value = "<?php echo $jam;  ?>" placeholder="<?php echo $jam;  ?>" readonly>
											<input class="form-control" id="disabledInput" type="hidden" name="jumlah_soal" value = "<?php echo "SOAL  ". $_SESSION['views']; ?>" placeholder="<?php echo "SOAL  ". $_SESSION['views']; ?>" readonly>
											<input class="form-control" id="disabledInput" type="hidden" name="jawab_hitung" value = "<?php echo $tm; ?>" placeholder="<?php echo $tm; ?>" readonly>
											<input class="form-control" id="disabledInput" type="hidden" name="sesi" value = "<?php echo $sesi; ?>" placeholder="<?php echo $sesi; ?>" readonly>

											
											<div class="form-group">
                                            <label>Pilihan</label>
                                            <div class="radio">
                                                <label>
                                                    <input type="radio" name="optionsRadios" id="optionsRadios1" value="lebih besar dari angka acak" checked>>
                                                </label>
                                            
                                            
                                                <label>
                                                    <input type="radio" name="optionsRadios" id="optionsRadios2" value="sama dengan">=
                                                </label>
                                            
                                            
                                                <label>
                                                    <input type="radio" name="optionsRadios" id="optionsRadios3" value="lebih kecil dari angka acak"><
                                                </label>
                                            </div>
                                        </div>
										<button type="submit" class="btn btn-default">Submit</button>
                                           <br><br><br><br><br><br><br><br>
                                        </div>
<?php										
  
  }
	

  
  }
			if ($pm >= $y) {
 
  $km= $pm-$y;
  
  
								if ($km >= $z) {
 
  $tm= $km-$z;
 
  
  ?>
  <div class="row">
                               
                              
                                         
                                            <div class="form-group">
                                                <label for="disabledSelect">Soal</label>
                                                <input class="form-control" id="disabledInput" type="text" name="soal" value="<?php  echo $v."+".$x."-".$y."-".$z;  ?>" placeholder="<?php  echo $v."+".$x."-".$y."-".$z;  ?>" readonly style="
    width: 50%;  font-size: -webkit-xxx-large;  height: 90%;  font-weight: 600;  text-align: center;">
                                            </div>
											<div class="form-group">
                                                <label for="disabledSelect">Angka Acak</label>
                                                <input class="form-control" id="disabledInput" type="text" name="jawaban" value="<?php echo $q;  ?>" placeholder="<?php echo $q;  ?>" readonly style="
    width: 50%;  font-size: -webkit-xxx-large;  height: 90%;  font-weight: 600;  text-align: center;">
                                            </div>  </fieldset>
											<br>
											
											
											
											
											<input class="form-control" id="disabledInput" type="hidden" name ="tanggal" value = "<?php echo $tanggal;  ?>" placeholder="<?php echo $tanggal;  ?>" readonly>
											<input class="form-control" id="disabledInput" type="hidden" name ="jam" value = "<?php echo $jam;  ?>" placeholder="<?php echo $jam;  ?>" readonly>
											<input class="form-control" id="disabledInput" type="hidden" name="jumlah_soal" value = "<?php echo "SOAL  ". $_SESSION['views']; ?>" placeholder="<?php echo "SOAL  ". $_SESSION['views']; ?>" readonly>
											<input class="form-control" id="disabledInput" type="hidden" name="jawab_hitung" value = "<?php echo $tm; ?>" placeholder="<?php echo $tm; ?>" readonly>
											<input class="form-control" id="disabledInput" type="hidden" name="sesi" value = "<?php echo $sesi; ?>" placeholder="<?php echo $sesi; ?>" readonly>
											
											
											
											<div class="form-group">
                                            <label>Pilihan</label>
                                            <div class="radio">
                                                <label>
                                                    <input type="radio" name="optionsRadios" id="optionsRadios1" value="lebih besar dari angka acak" checked>>
                                                </label>
                                            
                                            
                                                <label>
                                                    <input type="radio" name="optionsRadios" id="optionsRadios2" value="sama dengan">=
                                                </label>
                                            
                                            
                                                <label>
                                                    <input type="radio" name="optionsRadios" id="optionsRadios3" value="lebih kecil dari angka acak"><
                                                </label>
                                            </div>
                                        </div>
										<button type="submit" class="btn btn-default">Submit</button>
                                           <br><br><br><br><br><br><br><br>
                                        </div>
										
<?php										
  }
								if ($km < $z) {
 
  $tm= $km+$z;
 
  ?>
  <div class="row">
                               
                              
                                         
                                            <div class="form-group">
                                                <label for="disabledSelect">Soal</label>
                                                <input class="form-control" id="disabledInput" type="text" name="soal" value="<?php  echo $v."+".$x."-".$y."+".$z;  ?>" placeholder="<?php  echo $v."+".$x."-".$y."+".$z;  ?>" readonly style="
    width: 50%;  font-size: -webkit-xxx-large;  height: 90%;  font-weight: 600;  text-align: center;">
                                            </div>
											<div class="form-group">
                                                <label for="disabledSelect">angka Acak</label>
                                                <input class="form-control" id="disabledInput" type="text" name="jawaban" value="<?php echo $q;  ?>" placeholder="<?php echo $q;  ?>" readonly style="
    width: 50%;  font-size: -webkit-xxx-large;  height: 90%;  font-weight: 600;  text-align: center;">
                                            </div>  </fieldset>
											<br>
											
											
											
											<input class="form-control" id="disabledInput" type="hidden" name ="tanggal" value = "<?php echo $tanggal;  ?>" placeholder="<?php echo $tanggal;  ?>" readonly>
											<input class="form-control" id="disabledInput" type="hidden" name ="jam" value = "<?php echo $jam;  ?>" placeholder="<?php echo $jam;  ?>" readonly>
											<input class="form-control" id="disabledInput" type="hidden" name="jumlah_soal" value = "<?php echo "SOAL  ". $_SESSION['views']; ?>" placeholder="<?php echo "SOAL  ". $_SESSION['views']; ?>" readonly>
											<input class="form-control" id="disabledInput" type="hidden" name="jawab_hitung" value = "<?php echo $tm; ?>" placeholder="<?php echo $tm; ?>" readonly>
											<input class="form-control" id="disabledInput" type="hidden" name="sesi" value = "<?php echo $sesi; ?>" placeholder="<?php echo $sesi; ?>" readonly>
											
											
											
											<div class="form-group">
                                            <label>Pilihan</label>
                                            <div class="radio">
                                                <label>
                                                    <input type="radio" name="optionsRadios" id="optionsRadios1" value="lebih besar dari angka acak" checked>>
                                                </label>
                                            
                                            
                                                <label>
                                                    <input type="radio" name="optionsRadios" id="optionsRadios2" value="sama dengan">=
                                                </label>
                                            
                                            
                                                <label>
                                                    <input type="radio" name="optionsRadios" id="optionsRadios3" value="lebih kecil dari angka acak"><
                                                </label>
                                            </div>
                                        </div>
										<button type="submit" class="btn btn-default">Submit</button>
                                           <br><br><br><br><br><br><br><br>
                                        </div>
<?php										
  }  
  }  
}
?>


 

	  
	  
	   
                                    </form>
                                </div>
                                <!-- /.col-lg-6 (nested) -->
                            </div>
                            <!-- /.row (nested) -->
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                
    <!-- /#wrapper -->

    <!-- Core Scripts - Include with every page -->
    <script src="js/jquery-1.10.2.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script>

    <!-- Page-Level Plugin Scripts - Forms -->

    <!-- SB Admin Scripts - Include with every page -->
    <script src="js/sb-admin.js"></script>

    <!-- Page-Level Demo Scripts - Forms - Use for reference -->

</body>

</html>